package com.globalwave.filemanage.service;

import com.globalwave.common.U;
import com.globalwave.common.entity.Catalog;
import com.globalwave.common.service.CatalogServiceImpl;
import com.globalwave.filemanage.entity.Folder;

public class FolderServiceImpl 
       extends CatalogServiceImpl 
       implements FolderService {
    
	public FolderServiceImpl() {
		this.catalogType = Folder.class ;
	}
	
    public Catalog create(Catalog catalog) throws Exception {
    	Folder folder = (Folder) catalog ;
    	folder.setCreated_on(U.currentTimestamp()) ;
        return super.create(catalog);
    }
    

    public void update(Catalog catalog) throws Exception {
    	
    	Folder folder = (Folder) catalog ;
    	folder.addExclusions("created_on") ;
    	folder.addExclusions("catalog_id") ;
    	folder.addExclusions("pro_catalog_id") ;
    	folder.setUpdate_on(U.currentTimestamp()) ;
    	
        super.update(catalog) ;
    }
}
